<script setup lang="ts">
import { ref } from 'vue'
import ComA from './components/ComA.vue'
const car = ref('小黄车')
const count = ref(10)
// vue3中 v-model='count' ===  v-model:modelValue  等价于 :modelValue='count'   emit: 绑定了update:modelValue事件
// const update = (val: number) => {
//   console.log(val)
// }
// :后面的才是给子组件动态绑定的属性
// v-model:xxx='car'     相当于 :xxx='car'     @update:xxx='car=$event'
</script>

<template>
  <div class="home-page">父组件内:{{ count }} ----- {{ car }}</div>
  <div>子组件: <ComA v-model="count" v-model:car="car"></ComA></div>
  <!-- <ComA
    :modelValue="count"
    @update:model-value="count = $event"
    :car="car"
    @update:car="car = $event"
  ></ComA> -->
</template>

<style lang="scss" scoped></style>
